<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>



    <script>
        //都是13位，毫秒级
        var time = new Date()
        console.log(time.getTime()); //通过原型方法直接获得当前时间的毫秒值，准确：
        const timestamp = Date.parse(new Date()); //毫秒级被转换成000 Date.parse()将字符串或者时间对象直接转化成时间戳：【不推荐这种办法，毫秒级别的数值被转化为000。】
        console.log(timestamp);
    </script>
</body>

</html>